import confList from "./conf_list";

export default {
    data() {
        let headers = confList()
        return {
            tableKey: "t",
            //列表项原始配置
            headersOrg: confList(),
            //经过加工后实际生效的列表项配置
            headers: headers,
            headerConfigOpen:false,
            tableWidth: 0,
            tableScrollLeft: 0,
        }
    },
    mounted() {
        // setTimeout(() => {
        //     this.tableWidth = this.$refs.table.$refs.body.scrollWidth - this.$refs.table.$el.offsetWidth
        // },300)

    },
    methods: {
        onHeaderConfigChange(k,v){
            this.headers = v
            this.tableKey = k
        },
        scrollToLeft(){
            this.$refs.table.$refs.body.scrollLeft = 0
        },
        scrollToRight(){
            this.$refs.table.$refs.body.scrollLeft = this.$refs.table.$refs.body.scrollWidth - this.$refs.table.$el.offsetWidth
        },
        scrollToMiddle(){
            this.$refs.table.$refs.body.scrollLeft = (this.$refs.table.$refs.body.scrollWidth - this.$refs.table.$el.offsetWidth)/2
        },
        scrollSlider(v,b,c){
            // console.log(a)
            // console.log(b)
            // console.log(c)
            this.$refs.table.$refs.body.scrollLeft = v
        }
    },
}